package com.gy.niuer.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import com.gy.niuer.domain.Clinic;
import com.gy.niuer.domain.Doctor;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gy.niuer.domain.Scheduling;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

/**
* @Entity com.gy.niuer.domain.Scheduling
*/
@Mapper
public interface SchedulingMapper extends BaseMapper<Scheduling> {

    int updateCountById(@Param("count") Integer count, @Param("id") Integer id);

    Scheduling selectOneById(@Param("id") Integer id);

    int deleteByDoctorAndTime(@Param("doctor") int doctor, @Param("time") Date time);

    int selectCountByDoctorAndTime(@Param("doctor") int doctor, @Param("time") Date time);

    List<Scheduling> selectAllByDoctor(@Param("doctor") int doctor);

    @Update("update scheduling set count = count+1 where id = #{schedulId}")
    boolean updateCount(int schedulId);

    int updateCountByTimeAndDoctor(@Param("time") Date time, @Param("doctor") int doctor);
}
